sinclude scripts/env.mk

MAIN_SRC	:=
ifeq ("$(origin MAIN)", "command line")
MAIN_SRC	:= $(MAIN)
endif

OPT_FLAGS	+= -O0 -g
X_CFLAGS	+= -std=gnu11 $(OPT_FLAGS)
X_ASFLAGS	+= $(OPT_FLAGS)
X_LIBS		+=

ifeq ("$(origin PROF)", "command line")
X_DEFINES	+= PROFILE
X_LIBS		+= profiler
endif

ifeq ($(HOSTOS),Darwin)
endif

ifeq ($(HOSTOS),windows)
endif

X_INCDIRS	+=

SRC			+= *.c
NAME		:= CWC


define CUSTOM_TARGET_CMD
echo [OUTPUT] $@; \
$(LD) -r -T class.lds $(X_LDFLAGS) $(X_OBJS) -o $@.o $(X_LIBDIRS) $(X_LIBS); \
$(CC) $(X_LDFLAGS) -o $@ $@.o $(X_LIBDIRS) $(X_LIBS)
endef
